/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Quentin L
 */
@Embeddable
public class SerieHasGenrePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "serie_id")
    private int serieId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "genre_id")
    private int genreId;

    public SerieHasGenrePK() {
    }

    public SerieHasGenrePK(int serieId, int genreId) {
        this.serieId = serieId;
        this.genreId = genreId;
    }

    public int getSerieId() {
        return serieId;
    }

    public void setSerieId(int serieId) {
        this.serieId = serieId;
    }

    public int getGenreId() {
        return genreId;
    }

    public void setGenreId(int genreId) {
        this.genreId = genreId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) serieId;
        hash += (int) genreId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SerieHasGenrePK)) {
            return false;
        }
        SerieHasGenrePK other = (SerieHasGenrePK) object;
        if (this.serieId != other.serieId) {
            return false;
        }
        if (this.genreId != other.genreId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.SerieHasGenrePK[ serieId=" + serieId + ", genreId=" + genreId + " ]";
    }
    
}
